package com.syh.jn.scm.domain.operation.entity.financial;

import cn.redscarf.commons.util.other.ExtAssert;
import cn.redscarf.commons.util.validator.ValidationUtils;
import com.syh.core.ddd.domain.AbstractSimpleAggregate;
import com.syh.jn.scm.dto.operation.financial.FinancialAccountDto;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

/**
 * 金融机构账号
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class FinancialAccount extends AbstractSimpleAggregate<Long> {
  /**
   * id
   */
  private Long businessEntityId;
  /**
   * 登录账号
   */
  private String loginAccount;
  /**
   * 登录密码
   */
  private String loginPassword;

  public FinancialAccount(FinancialAccountDto dto) {
    ExtAssert.notNull(dto,"账号,密码不能为空");
    ValidationUtils.validate(dto);
    this.businessEntityId = dto.getBusinessEntityId();
    this.loginAccount = dto.getLoginAccount();
    this.loginPassword = dto.getLoginPassword();
  }
}
